package com.suhe.stock.dao;

import com.suhe.stock.entity.StockKLine;
import com.suhe.stock.entity.id.CodeDateIdClass;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Collection;

@Repository
public interface StockKLineDao extends JpaRepository<StockKLine, CodeDateIdClass> {

    default void batchSave(Collection<StockKLine> stockKLines) {
        stockKLines.parallelStream().forEach(stockKLine -> {
            this.save(stockKLine);
        });
    }

}
